home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 807 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.3 KB

  1. Path: wndrwrks.demon.co.uk!andy
  2. From: Andy Armstrong <andy@wndrwrks.demon.co.uk>
  3. Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3
  4. Subject: Re: Hungarian notation
  5. Date: Sat, 6 Jan 1996 17:28:47 +0000
  6. Organization: WonderWorks
  7. Distribution: world
  8. Message-ID: <4OTVxAAPFr7wEw37@wndrwrks.demon.co.uk>
  9. References: <30C40F77.53B5@swsbbs.com> <4behis$3cl@dux.dundee.ac.uk>
  10.  <RIGOTTI.95Dec29100514@roach.dra.hmg.gb> <4cd8fc$oud@news.manawatu.gen.nz>
  11.  <HtlknJAZAQ7wEwjl@wndrwrks.demon.co.uk> <60KgWmb-3RB@herold.franken.de>
  12. NNTP-Posting-Host: wndrwrks.demon.co.uk
  13. X-NNTP-Posting-Host: wndrwrks.demon.co.uk
  14. MIME-Version: 1.0
  15. X-Newsreader: Turnpike Version 1.10 <qBJsdVzqmTD$H3HpwSrFWKs0Aw>
  16.  
  17. In article <60KgWmb-3RB@herold.franken.de>, Joachim Durchholz
  18. <jhd@herold.franken.de> writes
  19. >andy@wndrwrks.demon.co.uk wrote 05.01.96 on Re: Hungarian notation:
  20. >
  21. >> In article <4cd8fc$oud@news.manawatu.gen.nz>, Chris Tutty
  22. >> <ctutty@manawatu.gen.nz> writes
  23. >>
  24. >> Consider also that variable names may be misleading anyway. In that
  25. >> sense there's no great difference between
  26. >>
  27. >>         someProc(MyString)
  28. >>
  29. >> and
  30. >>
  31. >>         someProc(pszMyString)
  32. >>
  33. >> either could quite happily refer to any other data type.
  34. >>
  35. >
  36. >This example does not occur in real life. Or rather, it better should not!
  37. >Anybody using meaningless names like "MyString" should be thrown out of  
  38. >the programming business. Depending on the actual semantics of "someProc",  
  39. >the parameter should be called "Message" or "Options" or "ParserInput" or  
  40. >whatever.
  41.  
  42. The semantics of someProc might by that it's a function to reverse the
  43. characters of a string in place in which case (psz)MyString would be a
  44. quite reasonable argument name (albeit not one which I would use).
  45.  
  46. My intention was to draw attention to the fact that HN is a form of
  47. documentation which in some ways is similar to indentation, choice of
  48. variable names and use of comments; specifically, if you use names,
  49. comments and indentation which don't accurately reflect what the program
  50. does you are guilty of a crime which is not greatly different from using
  51. HN incorrectly. Any redundant decoration which a language tolerates is
  52. potentially misleading.
  53.  
  54.   Andy Armstrong                  WonderWorks
  55.   Phone/fax: 01665 602868 Mobile: 0860 922719
  56.